package net.aiion.weave.spi.cards.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

import net.aiion.weave.spi.cards.Card;

@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({
    ElementType.FIELD, ElementType.METHOD
})
public @interface Property
{
    /**
     * The access modifier of the exposed property. For fields, all values {@link Access#READ_ONLY},
     * {@link Access#WRITE_ONLY} and {@link Access#READ_WRITE} are valid. For methods, only {@link Access#READ_ONLY} or
     * {@link Access#WRITE_ONLY} may be applied.
     * 
     * @return The access modifier of the property.
     */
    Access value() default Access.READ_WRITE;

    /**
     * The name of the property exposed to the component's corresponding {@link Card}. If no name is explicitly set, the
     * name of the {@link Property} annotated {@link Field} or {@link Method} is exposed to the {@link Card}.
     * 
     * @return The name of the property.
     */
    String name() default "";
}
